<?php
/**
{
    "messageId": "BIGINT //ID",
    "fromUid": "INT //发送用户@foreign::tbl_user; @search",
    "fromNick": "VARCHAR //发送方@noList; ",
    "isFromTeacher": "TINYINT //是老师发的消息@status; 0::学生发的; 1; :老师发的; ",
    "schoolId": "INT //机构id@foreign::tbl_school; @search; ",
    "teacherId": "INT //老师@foreign::tbl_teacher; @search; ",
    "fromAvatar": "VARCHAR //发送人@image; ",
    "toUid": "INT //接收用户@foreign::tbl_user; @search; ",
    "toNick": "VARCHAR //接受者@noList; ",
    "toAvatar": "VARCHAR //接收人@image; ",
    "msg": "TEXT //消息",
    "readStatus": "TINYINT //已读@status; 0::未读; 1::已读; ",
    "sendStatus": "TINYINT //是否发送@status; 0::未发送; 1::已发送; ",
    "sendResultCode": "VARCHAR //发送结果代码",
    "status": "TINYINT //状态@status::3::正常::@admin; 88::删除::@admin; ",
    "created": "DATETIME //创建时间"
}
 */

class Message extends Base
{
    
	public $messageId= '';//ID
	public $fromUid= '';//发送用户@foreign::tbl_user;@search
	public $fromNick= NULL;//发送方@noList;
	public $isFromTeacher= "1";//是老师发的消息@status;0::学生发的;1;:老师发的;
	public $schoolId= "0";//机构id@foreign::tbl_school;@search;
	public $teacherId= "0";//老师@foreign::tbl_teacher;@search;
	public $fromAvatar= NULL;//发送人@image;
	public $toUid= '';//接收用户@foreign::tbl_user;@search;
	public $toNick= NULL;//接受者@noList;
	public $toAvatar= NULL;//接收人@image;
	public $msg= '';//消息
	public $readStatus= "1";//已读@status;0::未读;1::已读;
	public $sendStatus= "0";//是否发送@status;0::未发送;1::已发送;
	public $sendResultCode= NULL;//发送结果代码
	public $status= "3";//状态@status::3::正常::@admin;88::删除::@admin;
	public $created= 'CURRENT_TIMESTAMP';//创建时间

    public $isDbData = false;

    public function __construct()
    {
        parent::__construct();
    }


    public function __get($name) {
        return $this->$name;
    }

    public function __set($name, $value) {
        if(!$this->isDbData){
            if(!in_array($name,$this->loadedFiled))$this->loadedFiled[] = $name;
        }

        $this->$name=$value;
        $this->arr[$name] = $value;
    }

    public  function table()
    {
        return 'tbl_message';
    }
    
    public  function key(){
        return 'messageId';
    }


    
    public static  function hideField()
    {
        return [];
    }
            
    public static  function skipField()
    {
        return [];
    }
            
    public static  function noViewField()
    {
        return [];
    }
            
    public static  function jsonField()
    {
        return [];
    }
            
    public static  function noLoadField()
    {
        return [];
    }
            
    public static  function deleteField()
    {
        return [];
    }
            
    public function className()
    {
        return 'Message';
    }
    
    public  function field()
    {
        return array (  'messageId' =>   array (    0 => 'BIGINT',    1 => 20,    2 => 'ID',  ),  'fromUid' =>   array (    0 => 'INT',    1 => 11,    2 => '发送用户@foreign::tbl_user;@search',  ),  'fromNick' =>   array (    0 => 'VARCHAR',    1 => 100,    2 => '发送方@noList;',  ),  'isFromTeacher' =>   array (    0 => 'TINYINT',    1 => 4,    2 => '是老师发的消息@status;0::学生发的;1;:老师发的;',  ),  'schoolId' =>   array (    0 => 'INT',    1 => 11,    2 => '机构id@foreign::tbl_school;@search;',  ),  'teacherId' =>   array (    0 => 'INT',    1 => 11,    2 => '老师@foreign::tbl_teacher;@search;',  ),  'fromAvatar' =>   array (    0 => 'VARCHAR',    1 => 255,    2 => '发送人@image;',  ),  'toUid' =>   array (    0 => 'INT',    1 => 11,    2 => '接收用户@foreign::tbl_user;@search;',  ),  'toNick' =>   array (    0 => 'VARCHAR',    1 => 100,    2 => '接受者@noList;',  ),  'toAvatar' =>   array (    0 => 'VARCHAR',    1 => 255,    2 => '接收人@image;',  ),  'msg' =>   array (    0 => 'TEXT',    1 => 0,    2 => '消息',  ),  'readStatus' =>   array (    0 => 'TINYINT',    1 => 4,    2 => '已读@status;0::未读;1::已读;',  ),  'sendStatus' =>   array (    0 => 'TINYINT',    1 => 4,    2 => '是否发送@status;0::未发送;1::已发送;',  ),  'sendResultCode' =>   array (    0 => 'VARCHAR',    1 => 20,    2 => '发送结果代码',  ),  'status' =>   array (    0 => 'TINYINT',    1 => 4,    2 => '状态@status::3::正常::@admin;88::删除::@admin;',  ),  'created' =>   array (    0 => 'DATETIME',    1 => 0,    2 => '创建时间',  ),);
    }


}